1 //+-----------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // Defines the utility functions of PresentationHost.
12 // Ported ByteRangeDownloader to WCP
14 // Ported Windows->DevDiv. See SourcesHistory.txt.
16 //------------------------------------------------------------------------
20 //******************************************************************************
24 //******************************************************************************
26 #define EMBEDDINGFLAG L"Embedding"
27 #define DEBUGFLAG L"Debug"
28 #define EVENTFLAG L"Event"
29 #define DEBUGSECURITYZONEURLFLAG L"DebugSecurityZoneURL"
30 #define LAUNCHDOTAPPLICATIONFLAG L"LaunchApplication"
31 #define REGISTERSERVERFLAG L"RegServer"
32 #define UNREGISTERSERVERFLAG L"UnregServer"
34 #define URL_SCHEME_SECURE L"https"
37 #define FLAG_EMBEDDING 0x01
38 #define FLAG_DEBUG 0x02
39 #define FLAG_EVENT 0x04
40 #define FLAG_DEBUGSECURITYZONEURL 0x08
41 #define FLAG_LAUNCHDOTAPPLICATION 0x10
42 #define FLAG_REGISTERSERVER 0x20
43 #define FLAG_UNREGISTERSERVER 0x40
45 // Combinations of flags
46 #define FLAGS_NONE 0x00
48 #define PATH_BUFFER_SIZE (MAX_PATH + 64)
49 #define DEBUGSECURITYZONEURL_BUFFER_SIZE (MAX_PATH + 64)
51 #ifdef APPLICATION_SHIM
52 // DFSHIM stuff for launching click once .application
53 #define DFDLL L"dfdll.dll"
54 #define URLACTION_MANAGED_UNSIGNED 0x00002004
55 #define URLACTION_MANAGED_SIGNED 0x00002001
56 typedef HRESULT (*fnActivateDeploymentEx
)(__in LPCWSTR deploymentUrl
, DWORD dwUnsignedPolicy
, DWORD dwSignedPolicy
);
59 //******************************************************************************
63 //******************************************************************************
65 HRESULT
ParseCommandLine(__out_ecount(1) LPDWORD pdwFlags
,
66 __out_ecount(nFileNameSize
) LPWSTR pwzFileName
,
68 __out_ecount(nEventNameSize
) LPWSTR pwzEventName
,
69 size_t nEventNameSize
,
70 __out_ecount(nDebugSecurityZoneURLSize
) LPWSTR pwzDebugSecurityZoneURL
,
71 size_t nDebugSecurityZoneURLSize
,
72 __out_ecount_opt(nDotApplicationURLSize
) LPWSTR pwzDotApplicationURL
,
73 size_t nDotApplicationURLSize
);
75 BOOL
MsgWaitForSingleObject(__in HANDLE hEvent
, DWORD dwMilliSeconds
, __out_ecount(1) BOOL
* fWmQuit
);
77 MimeType
GetMimeTypeFromString(LPCWSTR szMimeString
);
79 BOOL
IsValidMimeType(__in MimeType mime
);
81 // Returned message buffer must be freed with LocalFree().
82 wchar_t *TryDecodeDownloadError(HRESULT hr
);
84 // Defined in dll\Utilities.cxx
85 size_t LoadResourceString(int id
, __out_ecount(cchBufSize
) wchar_t *pBuf
, size_t cchBufSize
);
86 BSTR
LoadResourceString(int id
);
89 HRESULT
EndsWith(LPCWSTR szTarget
, LPCWSTR szMatch
);
93 //*********************************************************************************
95 //*********************************************************************************
96 #ifdef APPLICATION_SHIM
97 HRESULT
LaunchClickOnceApplication(LPCWSTR szApplicationURL
);